package com.fashion.web.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import java.io.IOException;

/**
 * User: keviyang
 * Date: 11-12-16
 */
public class PageTag extends SimpleTagSupport {
    private String type;

    @Override
    public void doTag() throws JspException, IOException {
        JspWriter out = getJspContext().getOut();

        if ("header".equalsIgnoreCase(type)) {
            printHeader(out);
        } else if ("footer".equalsIgnoreCase(type)) {
            printFooter(out);
        } else {

        }
    }

    protected void printFooter(JspWriter out){
         String text = "\t<div id='footer' class='area'>\n" +
                 "\t\t\t<div class='con'>\n" +
                 "\t\t\t\t<div class='company'><span>风尚中国旗下网站：</span>\n" +
                 "                    <a target='_blank' title='风尚中国网' href='http://www.fengsung.com/'>风尚中国</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='风尚网' href='http://www.voguechinese.com'>风尚网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='时髦网' href='http://www.ishimao.com/'>时髦网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='乐士网' href='http://www.luxe.cc/'>乐士网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='型男网' href='http://www.quanxingnan.com/'>型男网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='奢迷网' href='http://www.kissluxe.com/'>奢迷网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='翡翠迷' href='http://www.feicuimi.com/'>翡翠迷</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='度假网' href='http://www.365dujia.com/'>度假网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='游艇网' href='http://www.52boat.com/'>游艇网</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='我爱表' href='http://www.woaibiao.com/'>我爱表</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='婚嫁之家' href='http://www.wed5.cn/'>婚嫁之家</a>&nbsp;&nbsp;|&nbsp;&nbsp;\n" +
                 "                    <a target='_blank' title='私人飞机网' href='http://www.feijiw.com/'>私人飞机网</a>\n" +
                 "                </div>\n" +
                 "\t\t\t\t<div class='bottom'>\n" +
                 "\t\t\t\t\t<p class='aboutus'><a href='http://www.fengsung.com/company.html' target='_blank'>关于我们</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.condenastsub.com.cn/order_vogue.php?source=voguewww' target='_blank'>刊登广告</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/cooperation.html'>项目服务</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/hr/job-index.html' target='_blank'>人才中心</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/contactus.html' target='_blank'>联系我们</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/map.html' target='_blank'>友情链接</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/privacy.html' target='_blank'>RSS订阅</a>&nbsp;&nbsp;&nbsp;&nbsp;\n" +
                 "                        <a href='http://www.fengsung.com/copyright.html' target='_blank'>邮件订阅</a></p>\n" +
                 "\t\t\t\t\t<p class='copyright'>风尚中国 版权所有 Copyright 2010 FengSung.com, All rights reserved.<br>\n" +
                 "\t\t\t\t\t风尚中国[蜀ICP备08109843号]&nbsp; 成都洛科思文化传播有限公司\n" +
                 "\t\t\t\t</p>\n" +
                 "\t\t\t\t</div>\n" +
                 "\t\t\t</div>\n" +
                 "\t\t</div>";

        try {
            out.print(text);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    protected void printHeader(JspWriter out) {
          try {
            out.print("Not implemented yet!");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
